<?php
class Default_Form_ChangePass extends Zend_Form {

    public function init(){
        
        $this->setName("default");    
        $this->setAction('user/changepass');                   
                
        $currentPass = new Zend_Form_Element_Password('oldpwd');
        $currentPass->setLabel('Mật khẩu hiện tại')->setRequired(true)->addValidator('NotEmpty')->setAttrib('class','form-control');                

        $newPass = new Zend_Form_Element_Password('newpwd1');
        $newPass->setLabel('Mật khẩu mới')->setRequired(true)->addValidator('NotEmpty')->setAttrib('class','form-control');

        $confirmPass = new Zend_Form_Element_Password('newpwd2');
        $confirmPass->setLabel('Nhập lại mật khẩu mới')->setRequired(true)->addValidator('Identical',false,array('token' => 'newpwd1'))->setAttrib('class','form-control');
        $confirmPass->addErrorMessage('Password không khớp! ');        

        $submit = new Zend_Form_Element_Button('submit');
        $submit->setAttrib('type','submit');
        $submit->setAttrib('class','form-control')->setAttrib('style','width:40%;float:right;margin-top:10px;background-color:forestgreen');
        $submit->setLabel('Đổi mật khẩu');
        $submit->removeDecorator('dtddwrapper')->removeDecorator('HtmlTag')->removeDecorator('Label');

        $this->addElements(array($currentPass, $newPass,$confirmPass, $submit));
    }

} 
